<script setup lang="ts">
	import useUserStore from '@/store/userAccount'
	const userStore = useUserStore()

	const dialogRef = ref()
	const logout = () => {
		userStore.logOut()
	}

	const showDialog = () => {
		dialogRef.value!.show = true
	}

	const throttles = uni.$util.throttle(() => {
		uni.goToPage({
			url: 'pages/listDemo/listDemo'
		})
	}, 1000)
</script>
<template>
	<view class="index">
		<lx-header :title="'首页'">
			<template #left>
				<view>图标</view>
			</template>
		</lx-header>
		<view class="flex column">
			<button @click="logout">退出</button>
			<button @tap="showDialog">弹窗</button>
			<button @tap="throttles">列表测试</button>
		</view>
		<x-dialog ref="dialogRef" :show-cancel-button="true">
			<view>模态框，常用于消息提示、消息确认、在当前页面内完成特定的交互操作</view>
		</x-dialog>
		<lx-image src="https://wx1.sinaimg.cn/mw1024/9a43a9b4ly4hp0v7jfs2ij20u00k0gnv.jpg" />
	</view>
</template>

<style scoped lang="scss"></style>